IF EXISTS     (SELECT name    FROM [master].[sys].[server_principals]     WHERE name = 'administrator')
	drop login [administrator]
CREATE LOGIN [administrator] WITH PASSWORD=N'admin', DEFAULT_DATABASE=[QLNS], DEFAULT_LANGUAGE=[us_english], CHECK_EXPIRATION=OFF, CHECK_POLICY=OFF
GO

ALTER LOGIN [administrator] DISABLE
GO

ALTER SERVER ROLE [sysadmin] ADD MEMBER [administrator]
GO

ALTER SERVER ROLE [securityadmin] ADD MEMBER [administrator]
GO

--ALTER SERVER ROLE [serveradmin] ADD MEMBER [administrator]
--GO

--ALTER SERVER ROLE [setupadmin] ADD MEMBER [administrator]
--GO

--ALTER SERVER ROLE [processadmin] ADD MEMBER [administrator]
--GO

--ALTER SERVER ROLE [diskadmin] ADD MEMBER [administrator]
--GO

--ALTER SERVER ROLE [dbcreator] ADD MEMBER [administrator]
--GO

--ALTER SERVER ROLE [bulkadmin] ADD MEMBER [administrator]
--GO

IF  EXISTS (SELECT * FROM sys.database_principals WHERE name = N'admin')
	DROP USER [admin]
create user admin for login [administrator]
GRANT CONNECT TO [admin]
ALTER LOGIN [administrator] ENABLE
GO

use [QLNS]
go